set more off

* "This led to a sample with 50% of respondents from Punjab, 20% from Khyber Pakhtunkhwa, and 30% from Sindh."
fre province

* "Candidates supporting friendly relations with India were rated 0.01 points lower by respondents,"
* "a quantity indistinguishable from zero using conventional levels of statistical significance (p=.75)..."
reg likert india, cluster(new_id)

* "...and had a 2 percent lower probability of being selected in the forced choice setup, a modest but"
* "statistically significant difference (p<.05) from those advocating a hardline toward India.
reg forced india, cluster(new_id)

*** Figure 1: Provinces
reg forced india##province, cluster(new_id)
reg forced india, cluster(new_id)
eststo all
reg forced india if province==1, cluster(new_id)
eststo punjab
reg forced india if province==3, cluster(new_id)
eststo sindh
reg forced india if province==2, cluster(new_id)
eststo kpk
coefplot all punjab sindh kpk , drop(_cons) xline(0, lpattern(dash)) scheme(s1mono) legend(row(1))

*** Figure 2: Punjab
reg forced i.party i.biradari i.campaign i.agenda i.india if province==1, cluster(new_id)
coefplot, drop(_cons) xline(0, lpattern(dash)) baselevels scheme(s1mono)

* Footnote 11
gen punjabi=1 if ethnicity==2
replace punjabi=0 if ethnicity!=2
reg forced india if punjabi==1, cluster(new_id)
reg forced india if province==1&punjabi==1, cluster(new_id)

*** Figure 3: Education
* Education
gen educ3=1 if education==1|education==3
replace educ3=2 if education==4|education==5
replace educ3=3 if education==6|education==7|education==8
reg forced india if educ3==1, cluster(new_id)
est sto loeduc
reg forced india if educ3==2, cluster(new_id)
est sto mideduc
reg forced india if educ3==3, cluster(new_id)
est sto hieduc
reg forced india##educ3, cluster(new_id)

coefplot loeduc mideduc hieduc, drop(_cons) xline(0, lpattern(dash)) scheme(s1mono) legend(col(1))

*** Figure 4: Age
gen young=1 if age<30&age!=.
replace young=0 if age>=30&age!=.
gen middleage=1 if age>=30&age<=55
replace middleage=0 if middleage!=1&age!=.
gen old=1 if age>55&age!=.
replace old=0 if old!=1&age!=.
gen age_cat=1 if young==1
replace age_cat=2 if middleage==1
replace age_cat=3 if old==1

reg forced india##age_cat, cluster(new_id)
reg forced india if age_cat==1, cluster(new_id)
est sto young
reg forced india if age_cat==2, cluster(new_id)
est sto middleage
reg forced india if age_cat==3, cluster(new_id)
est sto old
reg forced india##age_cat, cluster(new_id)
test 2.india#2.age_cat=2.india#3.age_cat
coefplot young middleage old, drop(_cons) xline(0, lpattern(dash)) scheme(s1mono) legend(row(1))

* "In a subgroup test for those respondents who label India a “very serious” threat to Pakistan" 
* "(45% of our sample) compared to those voters who perceive India as a less serious threat..."
fre q50 
gen seriousthreat=1 if q50==1
replace seriousthreat=0 if seriousthreat!=1

* "...we find that the two groups do not differ in their choice of candidates who advocate hardline policies"
* "toward India (difference in means=0.008, p=.410). 
reg forced seriousthreat if india==2, cluster(new_id)
reg forced india##seriousthreat, cluster(new_id)
lincom 1.seriousthreat+1.seriousthreat#2.india

* "...PML-N supporters selecting candidates friendly toward India 2.5 percentage points (p<0.05)"
* "more often than non-PML-N supporters." 
gen pmln_close=1 if close_to_party==2
replace pmln_close=0 if close_to_party!=2&close_to_party!=.
reg forced pmln_close if india==2, cluster(new_id)
reg forced india##pmln_close, cluster(new_id)
lincom 1.pmln_close+1.pmln_close#2.india

****** Appendix

*** Appendix C
sum age, detail
gen hiincome=1 if income==5|income==6
replace hiincome=0 if income<=4
sum hiincome
gen low_educ=1 if education==1|education==2|education==3|education==4
replace low_educ=0 if low_educ!=1
sum low_educ
sum pmln_close
gen pti_close=1 if close_to_party==8
replace pti_close=0 if close_to_party!=8
sum pti_close
gen ppp_close=1 if close_to_party==1
replace ppp_close=0 if close_to_party!=1
sum ppp_close
sum gender
sum rural
gen punjab_res=1 if province==1
replace punjab_res=0 if province==2|province==3
sum punjab_res
gen sindh_res=1 if province==3
replace sindh_res=0 if province==1|province==2
sum sindh_res
gen kpk_res=1 if province==2
replace kpk_res=0 if province==1|province==3
sum kpk_res
gen muhajir=1 if ethnicity==1
replace muhajir=0 if ethnicity!=1
gen sindhi=1 if ethnicity==3
replace sindhi=0 if ethnicity!=3
gen pashtun=1 if ethnicity==6
replace pashtun=0 if ethnicity!=6
sum muhajir

*** Appendix D
gen age_sq=age*age
reg india hiincome low_educ pmln_close pti_close ppp_close gender age age_sq rural muhajir punjabi sindhi pashtun, cluster(new_id)

*** Appendix E
** Table E1
reg forced india, cluster(new_id)
reg likert india, cluster(new_id)

** Table E2
reg forced india, cluster(new_id)
reg forced india if province==1, cluster(new_id)
reg forced india if province==3, cluster(new_id)
reg forced india if province==2, cluster(new_id)
reg forced india##province, cluster(new_id)

** Table E3
reg forced i.party i.biradari i.campaign i.agenda i.india if province==1, cluster(new_id)

** Table E4
reg forced india if educ3==1, cluster(new_id)
reg forced india if educ3==2, cluster(new_id)
reg forced india if educ3==3, cluster(new_id)
reg forced india##educ3, cluster(new_id)

** Table E5
reg forced india if age_cat==1, cluster(new_id)
reg forced india if age_cat==2, cluster(new_id)
reg forced india if age_cat==3, cluster(new_id)
reg forced india##age_cat, cluster(new_id)

** Table E6
reg forced india##seriousthreat, cluster(new_id)

** Table E7
reg forced india##pmln_close, cluster(new_id)

*** Appendix F Alternative Age Cutoffs
* Alternative Age Cutoffs - Appendix F
* Model 1
gen alt_age3=0 if age<45
replace alt_age3=1 if age>=45
reg forced india##alt_age3, cluster(new_id)

* Model 2
gen alt_age4=0 if age<50
replace alt_age4=1 if age>=50
reg forced india##alt_age4, cluster(new_id)

* Model 3
gen alt_age1=.
replace alt_age1=1 if age<25
replace alt_age1=2 if age>=25&age<45
replace alt_age1=3 if age>=45
reg forced india##alt_age1, cluster(new_id)

* Model 4
gen alt_age2=1 if age<30&age!=.
replace alt_age2=2 if age>=30&age<50
replace alt_age2=3 if age>=50&age!=.
replace alt_age2=. if age==.
reg forced india##alt_age2, cluster(new_id)


